#!/bin/bash
set -x
echo 'Starting Hadoop....'>> /usr/local/src/installLog.log
# 启动hadoop
lockFile="/usr/local/src/start_hadoop_lock.d"
if [ ! -e "$lockFile" ]; then
    /usr/local/hadoop/bin/hdfs namenode -format
fi
/usr/local/hadoop/sbin/start-all.sh
# 停止java程序
echo 'Starting Hadoop end....'>> /usr/local/src/installLog.log
# ps -ef | grep "hadoopDocker-start"| grep -v grep | awk '{print $2}'| xargs kill -9